package com.hqd.ch03.v37.web.utils;

import com.hqd.ch03.utils.MultiValueMap;

import java.net.URI;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;

public interface UriBuilder {

    UriBuilder scheme(String scheme);

    UriBuilder userInfo(String userInfo);

    UriBuilder host(String host);

    UriBuilder port(int port);

    UriBuilder port(String port);

    UriBuilder path(String path);

    UriBuilder replacePath(String path);

    UriBuilder pathSegment(String... pathSegments) throws IllegalArgumentException;

    UriBuilder query(String query);

    UriBuilder replaceQuery(String query);

    UriBuilder queryParam(String name, Object... values);

    UriBuilder queryParam(String name, Collection<?> values);

    UriBuilder queryParamIfPresent(String name, Optional<?> value);

    UriBuilder queryParams(MultiValueMap<String, String> params);

    UriBuilder replaceQueryParam(String name, Object... values);

    UriBuilder replaceQueryParam(String name, Collection<?> values);

    UriBuilder replaceQueryParams(MultiValueMap<String, String> params);

    UriBuilder fragment(String fragment);

    URI build(Object... uriVariables);

    URI build(Map<String, ?> uriVariables);
}
